<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<div class="title">
	<s:a href="/admin/restList.html" cssClass="parent fl"><s:text name="admin.restList.title" /></s:a>
	<s:label cssClass="parent fl" value=">" />
	<s:label cssClass="current fl" key="admin.restAdd.title" />
	<s:a href="/admin/restList.html" cssClass="back fr">[<s:text name="common.button.back" />]</s:a>
	<div class="clear"></div>
	<hr class="title" />
</div>
<s:form action="/admin/doRestAdd.html" method="post" theme="simple">
	<s:hidden name="restId" />
	<s:token />
	<div class="table">
		<%-- 页面提示信息 --%>
		<div class="row">
			<div class="cell-label"></div>
			<div class="cell-text actionMessage h30">
				<s:actionerror />
			</div>
		</div>
		<%-- 餐馆名 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.restName" />:
			</div>
			<div class="cell-text">
				<s:textfield name="restBean.restName" cssClass="w240" />
			</div>
			<div class="fieldError w300">
				<s:fielderror fieldName="msg.restName" />
			</div>
		</div>
		<%-- 所属域名 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.serverName" />:
			</div>
			<div class="cell-text">
				<s:textfield name="restBean.serverName" cssClass="w240" />
			</div>
			<div class="fieldError w300">
				<s:fielderror fieldName="msg.serverName" />
			</div>
		</div>
		<%-- 有效期限 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.expirationDate" />:
			</div>
			<div class="cell-text">
				<%-- 日期不能直接输入到bean里，否则不填会报空指针 --%>
				<s:textfield name="expirationDate" cssClass="w240" />
			</div>
			<div class="fieldError w300">
				<s:fielderror fieldName="msg.expirationDate" />
			</div>
		</div>
		<%-- 餐厅管理员用户名 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.managerUserName" />:
			</div>
			<div class="cell-text">
				<s:textfield name="userBeanPage.userName" cssClass="w240" />
			</div>
			<div class="fieldError w300">
				<s:fielderror fieldName="msg.userName" />
			</div>
		</div>
		<%-- 餐厅管理员昵称 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.managerNickName" />:
			</div>
			<div class="cell-text">
				<s:textfield name="userBeanPage.nickName" cssClass="w240" />
			</div>
			<div class="fieldError w300">
				<s:fielderror fieldName="msg.nickName" />
			</div>
		</div>
		<%-- 餐厅经理默认语言 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.managerDefLang" />:
			</div>
			<div class="cell-text">
				<s:select label="默认语言" name="userBeanPage.defLangId" list="langList" listKey="langId" listValue="description" cssClass="w240" />
			</div>
			<div class="cell-desc"></div>
		</div>
		<%-- 餐厅管理员密码 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.managerPassword" />:
			</div>
			<div class="cell-text">
				<s:password name="userBeanPage.password" cssClass="w240" />
			</div>
			<div class="fieldError w300">
				<s:fielderror fieldName="msg.password" />
			</div>
		</div>
		<%-- 餐厅管理员确认密码 --%>
		<div class="row">
			<div class="cell-label">
				<s:label value="*" cssClass="star" />
				<s:text name="admin.restList.managerConfirmPassword" />:
			</div>
			<div class="cell-text">
				<s:password name="confirmPassword" cssClass="w240" />
			</div>
			<div class="fieldError w300">
				<s:fielderror fieldName="msg.confirmPassword" />
			</div>
		</div>
		<!-- 支持语言 -->
		<s:iterator value="langList" var="langBean" status="st">
			<div class="row">
				<div class="cell-label">
					<s:if test="#st.index == 0">
						<s:label value="*" cssClass="star" />
						<s:text name="admin.restList.langId" />:
					</s:if>
				</div>
				<div class="cell-text">
					<s:checkbox name="langId%{#st.index + 1}" fieldValue="%{#langBean.langId}" value="0" />
					<s:property value="#langBean.description" />
				</div>
				<div class="fieldError w300">
					<s:if test="#st.index == 0">
						<s:fielderror fieldName="msg.langId" />
					</s:if>
				</div>
			</div>
		</s:iterator>
		<%-- 描述 --%>
		<div class="row">
			<div class="cell-label"><s:text name="admin.restList.description" />:</div>
			<div class="cell-text">
				<s:textarea name="restBean.description" cssClass="w240" />
			</div>
		</div>
		<%-- 备注 --%>
		<div class="row">
			<div class="cell-label"><s:text name="admin.restList.remark" />:</div>
			<div class="cell-text">
				<s:textarea name="restBean.remark" cssClass="w240" />
			</div>
		</div>
		<div class="row">
			<div class="cell-label"></div>
			<div class="cell-button">
				<s:submit name="save" method="save" key="common.button.save" cssClass="button3" />
			</div>
		</div>
	</div>
</s:form>